package com.erbao.dp.observer;

/**
 * @author CaoBaoYin
 * @since 2021/9/13 21:12
 */
public class Main04 {
    public static void main(String[] args) {
        Child child = new Child();

        child.wakeup();
    }

    static class Dad {
        public void feed(){
            System.out.println(" dad feeding .......");
        }
    }

    static class Mom {
        public void hug(){
            System.out.println(" mom hugging ......");
        }
    }

    static class Dog{
        public void wang(){
            System.out.println(" dog wang......");
        }
    }

    static class Child {
        private boolean cry = false;
        private Dad dad = new Dad();
        private Mom mom = new Mom();
        private Dog dog = new Dog();

        public boolean isCry() {
            return cry;
        }

        public void wakeup() {
            System.out.println("wake up ! wuwuuwuwuu……");
            cry = true;
            dad.feed();
            mom.hug();
            dog.wang();
        }
    }
}
